-- ######## Check Admin ############

function isPlayerAdmin(gracz)
  local acc = getPlayerAccount ( gracz )
  local name = getAccountName ( acc )
  local Ad = isObjectInACLGroup ( "user." .. name, aclGetGroup ( "Admin" ) )
  return Ad
end


-- #######  Code ##################

--Start
function startujemy (res)
	if res == getThisResource() then
		team2 = createTeam ( "Team 2", 0, 0, 255)
		team1 = createTeam ( "Team 1", 255, 0, 0)
		setTimer(setGameType,5000,1,"Pier69 0.2" )
		setTeamFriendlyFire(team1,true)
		setTeamFriendlyFire(team2,true)
	for k,v in ipairs(getElementsByType ( "player" )) do
	setElementData(v,"Scores",0)
	spawnijWPoczekalni (v)
	end
	end
end

addEventHandler ( "onResourceStart", getRootElement(), startujemy )

function spawnijWPoczekalni (player)
	spawnPlayer( player,-2158, 643, 1053,0,0,1)


end